import reader
train_input_file='./data/dl-data/couplet/train/in.txt'
train_target_file='./data/dl-data/couplet/train/out.txt'
vocab_file='./data/dl-data/couplet/vocabs'
batch_size=32
train_reader = reader.SeqReader(train_input_file,train_target_file, vocab_file, batch_size)
#
# #SeqReader这个类中的属性有很多，看一下data[]就差不多了
# #发现[]里面的每一个数据如下形式：
# #{
# # 'in_seq': [71, 459, 157, 325, 55, 1],
# # 'in_seq_len': 6,
# # 'target_seq': [0, 47, 772, 472, 285, 202, 1],
# # 'target_seq_len': 6}
train_data = train_reader.read()
data=next(train_data)
print (train_reader.vocab_indices)
print (data['in_seq'])
print (data['in_seq_len'])
print (data['target_seq'])
print (data['target_seq_len'])

#解码一下
#infer_vocabs = reader.read_vocab(vocab_file)
#print(len(infer_vocabs))
#output_text = reader.decode_text(data, infer_vocabs)

#为了测试output，将是一场很大的困难
# 生成训练时候的图
in_seq = data['in_seq']
in_seq_len = data['in_seq_len']
target_seq = data['target_seq']
target_seq_len = data['target_seq_len']

#定制专有的损失函数权重，首先还是把in_seq中的最后一位拿出来，拼接上target_seq
f


import numpy as np
a=np.array([[1,2,3],[4,5,6,],[7,8,9]])
a=a[:,1:]
#print (a)